package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.销售顾问分组Model;
import com.iris.live.services.data.models.销售顾问分组ModelPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface 销售顾问分组Repository extends JpaRepository<销售顾问分组Model, 销售顾问分组ModelPK>, JpaSpecificationExecutor<销售顾问分组Model> {

    @Modifying
    @Query("update 销售顾问分组Model u  set u.组名=?1 where u.销售顾问=?2")
    void updSaleConsultantGruop(String 组名, String 销售顾问);

    @Modifying
    @Query("delete from  销售顾问分组Model u where u.销售顾问=?1")
    void delSaleConsultantGruop(String saleConsultant);

    @Query("select a from  销售顾问分组Model a where a.许可=?1 and a.销售顾问=?2")
    销售顾问分组Model findByPermitAndSc(String permit, String sc);
}
